package jsyf.oa.entity.system;

import com.alibaba.fastjson.JSONObject;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Table;

import jsyf.oa.ientity.BaseEntity;

/**
 * Created by WHH-PC on 2018/1/8.
 */
@Entity
@Table(name = "T_SYS_SIGN_IN", schema = "oa", catalog = "")
public class SignInEntity extends BaseEntity {
    //用户Id
    private String userId;

    //签到日期
    private String signDate;

    //上午
    private Double am;

    //下午
    private Double pm;

    //备注
    private String remark;

    //签到地址
    private String address;

    //经度
    private String longitude;

    //纬度
    private String latitude;

    //创建人
    private String createUserId;

    //签退时间
    private Date signOutTime;

    //签退经度
    private String signOutLongitude;

    //签退纬度
    private String signOutLatitude;

    //签退地址
    private String signOutAddress;

    //签到照片
    private String signUrl;

    //签退照片
    private String signOutUrl;

    //签到首次面访差距和签退末次面访差距
    private String signInDistance;
    private String signOutDistance;
    private String signInSpeed;
    private String signOutSpeed;
    private String signInTimeDiff;
    private String signOutTimeDiff;
    private String signOutAlwaysDistance;
    private String signInAlwaysDistance;

    public String getSignOutAlwaysDistance() {
        return signOutAlwaysDistance;
    }

    public void setSignOutAlwaysDistance(String signOutAlwaysDistance) {
        this.signOutAlwaysDistance = signOutAlwaysDistance;
    }

    public String getSignInAlwaysDistance() {
        return signInAlwaysDistance;
    }

    public void setSignInAlwaysDistance(String signInAlwaysDistance) {
        this.signInAlwaysDistance = signInAlwaysDistance;
    }

    public String getSignUrl() {
        return signUrl;
    }

    public void setSignUrl(String signUrl) {
        this.signUrl = signUrl;
    }

    public String getSignOutUrl() {
        return signOutUrl;
    }

    public void setSignOutUrl(String signOutUrl) {
        this.signOutUrl = signOutUrl;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getSignDate() {
        return signDate;
    }

    public void setSignDate(String signDate) {
        this.signDate = signDate;
    }

    public Double getAm() {
        return am;
    }

    public void setAm(Double am) {
        this.am = am;
    }

    public Double getPm() {
        return pm;
    }

    public void setPm(Double pm) {
        this.pm = pm;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }

    public Date getSignOutTime() {
        return signOutTime;
    }

    public void setSignOutTime(Date signOutTime) {
        this.signOutTime = signOutTime;
    }

    public String getSignOutLongitude() {
        return signOutLongitude;
    }

    public void setSignOutLongitude(String signOutLongitude) {
        this.signOutLongitude = signOutLongitude;
    }

    public String getSignOutLatitude() {
        return signOutLatitude;
    }

    public void setSignOutLatitude(String signOutLatitude) {
        this.signOutLatitude = signOutLatitude;
    }

    public String getSignOutAddress() {
        return signOutAddress;
    }

    public void setSignOutAddress(String signOutAddress) {
        this.signOutAddress = signOutAddress;
    }

    public String getSignInDistance() {
        return signInDistance;
    }

    public void setSignInDistance(String signInDistance) {
        this.signInDistance = signInDistance;
    }

    public String getSignOutDistance() {
        return signOutDistance;
    }

    public void setSignOutDistance(String signOutDistance) {
        this.signOutDistance = signOutDistance;
    }

    public String getSignInSpeed() {
        return signInSpeed;
    }

    public void setSignInSpeed(String signInSpeed) {
        this.signInSpeed = signInSpeed;
    }

    public String getSignOutSpeed() {
        return signOutSpeed;
    }

    public void setSignOutSpeed(String signOutSpeed) {
        this.signOutSpeed = signOutSpeed;
    }

    public String getSignInTimeDiff() {
        return signInTimeDiff;
    }

    public void setSignInTimeDiff(String signInTimeDiff) {
        this.signInTimeDiff = signInTimeDiff;
    }

    public String getSignOutTimeDiff() {
        return signOutTimeDiff;
    }

    public void setSignOutTimeDiff(String signOutTimeDiff) {
        this.signOutTimeDiff = signOutTimeDiff;
    }

    @Override
    public JSONObject getJSONObject() {
        JSONObject obj = new JSONObject();
        obj.put("ID", getId());
        obj.put("USER_ID", getUserId());
        obj.put("SIGN_DATE", getSignDate());
        obj.put("AM", getAm());
        obj.put("PM", getPm());
        obj.put("REMARK", getRemark());
        obj.put("ADDRESS", getAddress());
        obj.put("LONGITUDE", getLongitude());
        obj.put("LATITUDE", getLatitude());
        obj.put("CREATE_USER_ID", getCreateUserId());
        obj.put("CREATE_TIME", getCreateTime());
        obj.put("SIGN_OUT_TIME", getSignOutTime());
        obj.put("SIGN_OUT_LONGITUDE", getSignOutLongitude());
        obj.put("SIGN_OUT_LATITUDE", getSignOutLatitude());
        obj.put("SIGN_OUT_ADDRESS", getSignOutAddress());
        obj.put("SIGN_URL", getSignUrl());
        obj.put("SIGN_OUT_URL", getSignOutUrl());
        obj.put("SIGN_IN_DISTANCE", getSignInDistance());
        obj.put("SIGN_OUT_DISTANCE", getSignOutDistance());
        obj.put("SIGN_IN_SPEED", getSignInSpeed());
        obj.put("SIGN_OUT_SPEED", getSignOutSpeed());
        obj.put("SIGN_IN_TIME_DIFF", getSignInTimeDiff());
        obj.put("SIGN_OUT_TIME_DIFF", getSignOutTimeDiff());
        obj.put("SIGN_OUT_ALWAYS_DISTANCE", getSignOutAlwaysDistance());
        obj.put("SIGN_IN_ALWAYS_DISTANCE", getSignInAlwaysDistance());
        return obj;
    }

    @Override
    public String getTableName() {
        return "T_SYS_SIGN_IN";
    }

    @Override
    public String getViewName() {
        return "V_SYS_SIGN_LEAVE";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("USER_ID", "userId");
        obj.put("SIGN_DATE", "signDate");
        obj.put("AM", "am");
        obj.put("PM", "pm");
        obj.put("REMARK", "remark");
        obj.put("ADDRESS", "address");
        obj.put("LONGITUDE", "longitude");
        obj.put("LATITUDE", "latitude");
        obj.put("CREATE_USER_ID", "createUserId");
        obj.put("SIGN_OUT_TIME", "signOutTime");
        obj.put("CREATE_TIME", "createTime");
        obj.put("SIGN_OUT_LONGITUDE", "signOutLongitude");
        obj.put("SIGN_OUT_LATITUDE", "signOutLatitude");
        obj.put("SIGN_OUT_ADDRESS", "signOutAddress");
        obj.put("SIGN_URL", "signUrl");
        obj.put("SIGN_OUT_URL", "signOutUrl");
        obj.put("SIGN_IN_DISTANCE", "signInDistance");
        obj.put("SIGN_OUT_DISTANCE", "signOutDistance");
        obj.put("SIGN_IN_SPEED", "signInSpeed");
        obj.put("SIGN_OUT_SPEED", "signOutSpeed");
        obj.put("SIGN_IN_TIME_DIFF", "signInTimeDiff");
        obj.put("SIGN_OUT_TIME_DIFF", "signOutTimeDiff");
        obj.put("SIGN_OUT_ALWAYS_DISTANCE", "signOutAlwaysDistance");
        obj.put("SIGN_IN_ALWAYS_DISTANCE", "signInAlwaysDistance");
        return obj;
    }

}
